/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "collectioncode")
@NamedQueries({
    @NamedQuery(name = "Collectioncode.findAll", query = "SELECT c FROM Collectioncode c"),
    @NamedQuery(name = "Collectioncode.findByIdcollectioncode", query = "SELECT c FROM Collectioncode c WHERE c.idcollectioncode = :idcollectioncode"),
    @NamedQuery(name = "Collectioncode.findByCollectioncode", query = "SELECT c FROM Collectioncode c WHERE c.collectioncode = :collectioncode")})
public class Collectioncode implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcollectioncode")
    private Integer idcollectioncode;
    @Basic(optional = false)
    @Column(name = "collectioncode")
    private String collectioncode;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectioncode", fetch = FetchType.LAZY)
    private List<Recordlevelelement> recordlevelelementList;

    public Collectioncode() {
    }

    public Collectioncode(Integer idcollectioncode) {
        this.idcollectioncode = idcollectioncode;
    }

    public Collectioncode(Integer idcollectioncode, String collectioncode) {
        this.idcollectioncode = idcollectioncode;
        this.collectioncode = collectioncode;
    }

    public Integer getIdcollectioncode() {
        return idcollectioncode;
    }

    public void setIdcollectioncode(Integer idcollectioncode) {
        this.idcollectioncode = idcollectioncode;
    }

    public String getCollectioncode() {
        return collectioncode;
    }

    public void setCollectioncode(String collectioncode) {
        this.collectioncode = collectioncode;
    }

    public List<Recordlevelelement> getRecordlevelelementList() {
        return recordlevelelementList;
    }

    public void setRecordlevelelementList(List<Recordlevelelement> recordlevelelementList) {
        this.recordlevelelementList = recordlevelelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcollectioncode != null ? idcollectioncode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Collectioncode)) {
            return false;
        }
        Collectioncode other = (Collectioncode) object;
        if ((this.idcollectioncode == null && other.idcollectioncode != null) || (this.idcollectioncode != null && !this.idcollectioncode.equals(other.idcollectioncode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Collectioncode[idcollectioncode=" + idcollectioncode + "]";
    }

}
